package com.yv.websocket.controller.v4;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;

import com.yv.websocket.service.WebSocketService;

/**
 * 功能描述： 实时推送服务器的JVM负载，已用内存等消息
 *
 */

@Controller
public class V4ServerInfoController {

	@Autowired
	private WebSocketService ws;
	
	//http://localhost:8080/v4/index.html
	@MessageMapping("/v4/schedule/push")
	@Scheduled(fixedRate = 3000)  //方法不能加参数 
	public void sendServerInfo(){
		ws.sendServerInfo();
	}
	
	
}
